package com.promise.jokerdream.ui.settings

import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.*
import androidx.compose.material3.*
import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.promise.jokerdream.database.entity.SectGameConfigEntity
import com.promise.jokerdream.ui.components.SettingCard
import com.promise.jokerdream.ui.components.CheckboxOptionRow
import com.promise.jokerdream.ui.components.RoundCheckbox
import com.promise.jokerdream.ui.theme.AppSpacing

/**
 * 门派设置卡片
 */
@Composable
fun SectSettingCard(
    config: SectGameConfigEntity,
    onSectChange: (Boolean) -> Unit,
    onPaidIncenseChange: (Boolean) -> Unit,
    onPaidMemberTrainingChange: (Boolean) -> Unit,
    modifier: Modifier = Modifier,
    onExecuteClick: (() -> Unit)? = null
) {
    SettingCard(
        title = "门派",
        description = "门派上香等日常任务",
        checked = config.enabledSetting,
        onCheckedChange = onSectChange,
        modifier = modifier,
        onExecuteClick = onExecuteClick,
        content = {
            if (config.enabledSetting) {
                Column(
                    modifier = Modifier.fillMaxWidth(),
                    verticalArrangement = Arrangement.spacedBy(AppSpacing.componentMedium)
                ) {
                    // 付费上香
                    CheckboxOptionRow(
                        title = "付费上香",
                        checked = config.paidIncenseEnabled,
                        onCheckedChange = onPaidIncenseChange
                    )

                    // 付费同门切磋
                    CheckboxOptionRow(
                        title = "付费同门切磋",
                        checked = config.paidMemberTrainingEnabled,
                        onCheckedChange = onPaidMemberTrainingChange
                    )
                }
            }
        }
    )
}
